package com.dragon.modules.yuegou.query.act;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.act.GiftEntity;
import com.dragon.modules.yuegou.enums.act.GiftCommodityType;
import com.dragon.modules.yuegou.enums.act.GiftStatus;
import com.dragon.modules.yuegou.enums.act.GiftType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 送礼表 动态查询条件
 *
 * @author pbuilder generated
 * @date 2021-05-11 17:09:45
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class GiftQuery extends GiftEntity implements Query<GiftEntity> {

	/** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

	/** 排序查询条件 */
	@JsonUnwrapped(prefix = "sortNo")
	private Condition<Integer> sortNoCondition;

	/** [枚举]类型：0-注册送礼-REGISTERED、1-完善资料-PERFECT查询条件 */
	@JsonUnwrapped(prefix = "type")
	private Condition<GiftType> typeCondition;

	/** 活动状态：0-启用-START、1-停用-OVER查询条件 */
	@JsonUnwrapped(prefix = "openType")
	private Condition<Boolean> openTypeCondition;

	/** 商圈Id查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

	/** 活动名称查询条件 */
	@JsonUnwrapped(prefix = "activityName")
	private Condition<String> activityNameCondition;

	/** 活动物品id查询条件 */
	@JsonUnwrapped(prefix = "articleId")
	private Condition<String> articleIdCondition;

	/** [枚举]活动商品类型：0-停车券-PARK_COUPON、1-代金券-VOUCHER_COUPON、2-积分-POINTS、3-优惠券-COUP、4-套餐-PACKAGE查询条件 */
	@JsonUnwrapped(prefix = "commodityType")
	private Condition<GiftCommodityType> commodityTypeCondition;

	/** 活动商品名称查询条件 */
	@JsonUnwrapped(prefix = "commodityName")
	private Condition<String> commodityNameCondition;

	/** 活动积分查询条件 */
	@JsonUnwrapped(prefix = "articlePoints")
	private Condition<Integer> articlePointsCondition;

	/** [枚举]活动状态：0-未开始-ABOUT_START、1-赠送中-PROCESSIONG、2-已结束-OVER查询条件 */
	@JsonUnwrapped(prefix = "status")
	private Condition<GiftStatus> statusCondition;

	/** 活动开始时间查询条件 */
	@JsonUnwrapped(prefix = "activityBeginTime")
	private Condition<LocalDateTime> activityBeginTimeCondition;

	/** 活动结束时间查询条件 */
	@JsonUnwrapped(prefix = "activityEndTime")
	private Condition<LocalDateTime> activityEndTimeCondition;

	/** 创建人ID查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

	/** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

	/** 逻辑删除，1表示已删除,0表示未删除查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

	/** 删除人ID查询条件 */
	@JsonUnwrapped(prefix = "delBy")
	private Condition<String> delByCondition;

	/** 删除时间查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public GiftQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 *
	 * @param entity 实体对象
	 */
	public GiftQuery(GiftEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 *
	 * @param other 查询条件对象
	 */
	public GiftQuery(GiftQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.sortNoCondition != null) {
			this.sortNoCondition = other.sortNoCondition.copy();
		}
		if(other.typeCondition != null) {
			this.typeCondition = other.typeCondition.copy();
		}
		if(other.openTypeCondition != null) {
			this.openTypeCondition = other.openTypeCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.activityNameCondition != null) {
			this.activityNameCondition = other.activityNameCondition.copy();
		}
		if(other.articleIdCondition != null) {
			this.articleIdCondition = other.articleIdCondition.copy();
		}
		if(other.commodityTypeCondition != null) {
			this.commodityTypeCondition = other.commodityTypeCondition.copy();
		}
		if(other.commodityNameCondition != null) {
			this.commodityNameCondition = other.commodityNameCondition.copy();
		}
		if(other.articlePointsCondition != null) {
			this.articlePointsCondition = other.articlePointsCondition.copy();
		}
		if(other.statusCondition != null) {
			this.statusCondition = other.statusCondition.copy();
		}
		if(other.activityBeginTimeCondition != null) {
			this.activityBeginTimeCondition = other.activityBeginTimeCondition.copy();
		}
		if(other.activityEndTimeCondition != null) {
			this.activityEndTimeCondition = other.activityEndTimeCondition.copy();
		}
		if(other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		this.setOther(other);
	}
	private void setOther(GiftQuery other){
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delByCondition != null) {
			this.delByCondition = other.delByCondition.copy();
		}
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<GiftEntity> toQueryWrapper() {
		QueryWrapper<GiftEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (sortNoCondition != null) {
			sortNoCondition.toWrapper(wrapper, COL_SORT_NO);
		}
		if (typeCondition != null) {
			typeCondition.toWrapper(wrapper, COL_TYPE);
		}
		if (openTypeCondition != null) {
			openTypeCondition.toWrapper(wrapper, COL_OPEN_TYPE);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (activityNameCondition != null) {
			activityNameCondition.toWrapper(wrapper, COL_ACTIVITY_NAME);
		}
		if (articleIdCondition != null) {
			articleIdCondition.toWrapper(wrapper, COL_ARTICLE_ID);
		}
		if (commodityTypeCondition != null) {
			commodityTypeCondition.toWrapper(wrapper, COL_COMMODITY_TYPE);
		}
		if (commodityNameCondition != null) {
			commodityNameCondition.toWrapper(wrapper, COL_COMMODITY_NAME);
		}
		if (articlePointsCondition != null) {
			articlePointsCondition.toWrapper(wrapper, COL_ARTICLE_POINTS);
		}
		if (statusCondition != null) {
			statusCondition.toWrapper(wrapper, COL_STATUS);
		}
		if (activityBeginTimeCondition != null) {
			activityBeginTimeCondition.toWrapper(wrapper, COL_ACTIVITY_BEGIN_TIME);
		}
		if (activityEndTimeCondition != null) {
			activityEndTimeCondition.toWrapper(wrapper, COL_ACTIVITY_END_TIME);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		return getQueryWrapper(wrapper);
	}
	private QueryWrapper<GiftEntity> getQueryWrapper(QueryWrapper<GiftEntity> wrapper){
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delByCondition != null) {
			delByCondition.toWrapper(wrapper, COL_DEL_BY);
		}
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 *
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}

	/**
	 * 获取查询条件
	 *
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 *
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回排序查询条件
	 *
	 * @return sortNoCondition 排序查询条件
	 */
	public Condition<Integer> sortNo() {
		this.sortNoCondition = new Condition<>();
		return this.sortNoCondition;
	}

	/**
	 * 获取排序查询条件
	 *
	 * @return sortNoCondition 排序查询条件
	 */
	public Condition<Integer> getSortNoCondition() {
		return sortNoCondition;
	}

	/**
	 * 设置排序查询条件
	 *
	 * @param sortNoCondition 排序查询条件
	 */
	public void setSortNoCondition(Condition<Integer> sortNoCondition) {
		this.sortNoCondition = sortNoCondition;
	}

	/**
	 * 构造并返回[枚举]类型：0-注册送礼-REGISTERED、1-完善资料-PERFECT查询条件
	 *
	 * @return typeCondition [枚举]类型：0-注册送礼-REGISTERED、1-完善资料-PERFECT查询条件
	 */
	public Condition<GiftType> type() {
		this.typeCondition = new Condition<>();
		return this.typeCondition;
	}

	/**
	 * 获取[枚举]类型：0-注册送礼-REGISTERED、1-完善资料-PERFECT查询条件
	 *
	 * @return typeCondition [枚举]类型：0-注册送礼-REGISTERED、1-完善资料-PERFECT查询条件
	 */
	public Condition<GiftType> getTypeCondition() {
		return typeCondition;
	}

	/**
	 * 设置[枚举]类型：0-注册送礼-REGISTERED、1-完善资料-PERFECT查询条件
	 *
	 * @param typeCondition [枚举]类型：0-注册送礼-REGISTERED、1-完善资料-PERFECT查询条件
	 */
	public void setTypeCondition(Condition<GiftType> typeCondition) {
		this.typeCondition = typeCondition;
	}

	/**
	 * 构造并返回活动状态：0-启用-START、1-停用-OVER查询条件
	 *
	 * @return openTypeCondition 活动状态：0-启用-START、1-停用-OVER查询条件
	 */
	public Condition<Boolean> openType() {
		this.openTypeCondition = new Condition<>();
		return this.openTypeCondition;
	}

	/**
	 * 获取活动状态：0-启用-START、1-停用-OVER查询条件
	 *
	 * @return openTypeCondition 活动状态：0-启用-START、1-停用-OVER查询条件
	 */
	public Condition<Boolean> getOpenTypeCondition() {
		return openTypeCondition;
	}

	/**
	 * 设置活动状态：0-启用-START、1-停用-OVER查询条件
	 *
	 * @param openTypeCondition 活动状态：0-启用-START、1-停用-OVER查询条件
	 */
	public void setOpenTypeCondition(Condition<Boolean> openTypeCondition) {
		this.openTypeCondition = openTypeCondition;
	}

	/**
	 * 构造并返回商圈Id查询条件
	 *
	 * @return busdIdCondition 商圈Id查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}

	/**
	 * 获取商圈Id查询条件
	 *
	 * @return busdIdCondition 商圈Id查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈Id查询条件
	 *
	 * @param busdIdCondition 商圈Id查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回活动名称查询条件
	 *
	 * @return activityNameCondition 活动名称查询条件
	 */
	public Condition<String> activityName() {
		this.activityNameCondition = new Condition<>();
		return this.activityNameCondition;
	}

	/**
	 * 获取活动名称查询条件
	 *
	 * @return activityNameCondition 活动名称查询条件
	 */
	public Condition<String> getActivityNameCondition() {
		return activityNameCondition;
	}

	/**
	 * 设置活动名称查询条件
	 *
	 * @param activityNameCondition 活动名称查询条件
	 */
	public void setActivityNameCondition(Condition<String> activityNameCondition) {
		this.activityNameCondition = activityNameCondition;
	}

	/**
	 * 构造并返回活动物品id查询条件
	 *
	 * @return articleIdCondition 活动物品id查询条件
	 */
	public Condition<String> articleId() {
		this.articleIdCondition = new Condition<>();
		return this.articleIdCondition;
	}

	/**
	 * 获取活动物品id查询条件
	 *
	 * @return articleIdCondition 活动物品id查询条件
	 */
	public Condition<String> getArticleIdCondition() {
		return articleIdCondition;
	}

	/**
	 * 设置活动物品id查询条件
	 *
	 * @param articleIdCondition 活动物品id查询条件
	 */
	public void setArticleIdCondition(Condition<String> articleIdCondition) {
		this.articleIdCondition = articleIdCondition;
	}

	/**
	 * 构造并返回[枚举]活动商品类型：0-停车券-PARK_COUPON、1-代金券-VOUCHER_COUPON、2-积分-POINTS、3-优惠券-COUP、4-套餐-PACKAGE查询条件
	 *
	 * @return commodityTypeCondition [枚举]活动商品类型：0-停车券-PARK_COUPON、1-代金券-VOUCHER_COUPON、2-积分-POINTS、3-优惠券-COUP、4-套餐-PACKAGE查询条件
	 */
	public Condition<GiftCommodityType> commodityType() {
		this.commodityTypeCondition = new Condition<>();
		return this.commodityTypeCondition;
	}

	/**
	 * 获取[枚举]活动商品类型：0-停车券-PARK_COUPON、1-代金券-VOUCHER_COUPON、2-积分-POINTS、3-优惠券-COUP、4-套餐-PACKAGE查询条件
	 *
	 * @return commodityTypeCondition [枚举]活动商品类型：0-停车券-PARK_COUPON、1-代金券-VOUCHER_COUPON、2-积分-POINTS、3-优惠券-COUP、4-套餐-PACKAGE查询条件
	 */
	public Condition<GiftCommodityType> getCommodityTypeCondition() {
		return commodityTypeCondition;
	}

	/**
	 * 设置[枚举]活动商品类型：0-停车券-PARK_COUPON、1-代金券-VOUCHER_COUPON、2-积分-POINTS、3-优惠券-COUP、4-套餐-PACKAGE查询条件
	 *
	 * @param commodityTypeCondition [枚举]活动商品类型：0-停车券-PARK_COUPON、1-代金券-VOUCHER_COUPON、2-积分-POINTS、3-优惠券-COUP、4-套餐-PACKAGE查询条件
	 */
	public void setCommodityTypeCondition(Condition<GiftCommodityType> commodityTypeCondition) {
		this.commodityTypeCondition = commodityTypeCondition;
	}

	/**
	 * 构造并返回活动商品名称查询条件
	 *
	 * @return commodityNameCondition 活动商品名称查询条件
	 */
	public Condition<String> commodityName() {
		this.commodityNameCondition = new Condition<>();
		return this.commodityNameCondition;
	}

	/**
	 * 获取活动商品名称查询条件
	 *
	 * @return commodityNameCondition 活动商品名称查询条件
	 */
	public Condition<String> getCommodityNameCondition() {
		return commodityNameCondition;
	}

	/**
	 * 设置活动商品名称查询条件
	 *
	 * @param commodityNameCondition 活动商品名称查询条件
	 */
	public void setCommodityNameCondition(Condition<String> commodityNameCondition) {
		this.commodityNameCondition = commodityNameCondition;
	}

	/**
	 * 构造并返回活动积分查询条件
	 *
	 * @return articlePointsCondition 活动积分查询条件
	 */
	public Condition<Integer> articlePoints() {
		this.articlePointsCondition = new Condition<>();
		return this.articlePointsCondition;
	}

	/**
	 * 获取活动积分查询条件
	 *
	 * @return articlePointsCondition 活动积分查询条件
	 */
	public Condition<Integer> getArticlePointsCondition() {
		return articlePointsCondition;
	}

	/**
	 * 设置活动积分查询条件
	 *
	 * @param articlePointsCondition 活动积分查询条件
	 */
	public void setArticlePointsCondition(Condition<Integer> articlePointsCondition) {
		this.articlePointsCondition = articlePointsCondition;
	}

	/**
	 * 构造并返回[枚举]活动状态：0-未开始-ABOUT_START、1-赠送中-PROCESSIONG、2-已结束-OVER查询条件
	 *
	 * @return statusCondition [枚举]活动状态：0-未开始-ABOUT_START、1-赠送中-PROCESSIONG、2-已结束-OVER查询条件
	 */
	public Condition<GiftStatus> status() {
		this.statusCondition = new Condition<>();
		return this.statusCondition;
	}

	/**
	 * 获取[枚举]活动状态：0-未开始-ABOUT_START、1-赠送中-PROCESSIONG、2-已结束-OVER查询条件
	 *
	 * @return statusCondition [枚举]活动状态：0-未开始-ABOUT_START、1-赠送中-PROCESSIONG、2-已结束-OVER查询条件
	 */
	public Condition<GiftStatus> getStatusCondition() {
		return statusCondition;
	}

	/**
	 * 设置[枚举]活动状态：0-未开始-ABOUT_START、1-赠送中-PROCESSIONG、2-已结束-OVER查询条件
	 *
	 * @param statusCondition [枚举]活动状态：0-未开始-ABOUT_START、1-赠送中-PROCESSIONG、2-已结束-OVER查询条件
	 */
	public void setStatusCondition(Condition<GiftStatus> statusCondition) {
		this.statusCondition = statusCondition;
	}

	/**
	 * 构造并返回活动开始时间查询条件
	 *
	 * @return activityBeginTimeCondition 活动开始时间查询条件
	 */
	public Condition<LocalDateTime> activityBeginTime() {
		this.activityBeginTimeCondition = new Condition<>();
		return this.activityBeginTimeCondition;
	}

	/**
	 * 获取活动开始时间查询条件
	 *
	 * @return activityBeginTimeCondition 活动开始时间查询条件
	 */
	public Condition<LocalDateTime> getActivityBeginTimeCondition() {
		return activityBeginTimeCondition;
	}

	/**
	 * 设置活动开始时间查询条件
	 *
	 * @param activityBeginTimeCondition 活动开始时间查询条件
	 */
	public void setActivityBeginTimeCondition(Condition<LocalDateTime> activityBeginTimeCondition) {
		this.activityBeginTimeCondition = activityBeginTimeCondition;
	}

	/**
	 * 构造并返回活动结束时间查询条件
	 *
	 * @return activityEndTimeCondition 活动结束时间查询条件
	 */
	public Condition<LocalDateTime> activityEndTime() {
		this.activityEndTimeCondition = new Condition<>();
		return this.activityEndTimeCondition;
	}

	/**
	 * 获取活动结束时间查询条件
	 *
	 * @return activityEndTimeCondition 活动结束时间查询条件
	 */
	public Condition<LocalDateTime> getActivityEndTimeCondition() {
		return activityEndTimeCondition;
	}

	/**
	 * 设置活动结束时间查询条件
	 *
	 * @param activityEndTimeCondition 活动结束时间查询条件
	 */
	public void setActivityEndTimeCondition(Condition<LocalDateTime> activityEndTimeCondition) {
		this.activityEndTimeCondition = activityEndTimeCondition;
	}

	/**
	 * 构造并返回创建人ID查询条件
	 *
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}

	/**
	 * 获取创建人ID查询条件
	 *
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置创建人ID查询条件
	 *
	 * @param createdByCondition 创建人ID查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 *
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}

	/**
	 * 获取创建时间查询条件
	 *
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 *
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回逻辑删除，1表示已删除,0表示未删除查询条件
	 *
	 * @return delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}

	/**
	 * 获取逻辑删除，1表示已删除,0表示未删除查询条件
	 *
	 * @return delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置逻辑删除，1表示已删除,0表示未删除查询条件
	 *
	 * @param delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回删除人ID查询条件
	 *
	 * @return delByCondition 删除人ID查询条件
	 */
	public Condition<String> delBy() {
		this.delByCondition = new Condition<>();
		return this.delByCondition;
	}

	/**
	 * 获取删除人ID查询条件
	 *
	 * @return delByCondition 删除人ID查询条件
	 */
	public Condition<String> getDelByCondition() {
		return delByCondition;
	}

	/**
	 * 设置删除人ID查询条件
	 *
	 * @param delByCondition 删除人ID查询条件
	 */
	public void setDelByCondition(Condition<String> delByCondition) {
		this.delByCondition = delByCondition;
	}

	/**
	 * 构造并返回删除时间查询条件
	 *
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}

	/**
	 * 获取删除时间查询条件
	 *
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置删除时间查询条件
	 *
	 * @param delTimeCondition 删除时间查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

}
